﻿angular.module('myApp').controller('pageController', function ($scope, $http) {
    var foo;
    var arrList = [{ name: "borkata" }, { name: "pesho" }, { name: "gosho" }];
   // var intervalVar;
    function addItemToArray() {
        var inputObj = {
            name: "Hello World"
        };
        arrList.push(inputObj);
        console.log(arrList);
        $scope.listItems = arrList;

    }


    $scope.startAdding = function () {
        intervalVar = setInterval(addItemToArray, 500);
    };
    
    $scope.stopAdding = function() {
        clearInterval(intervalVar);
    };



});









